const Koa = require('koa')
const app = new Koa()
const views = require('koa-views')
const { resolve } = require('path')

//路径 扩展名为pug的文件
app.use(views(resolve(__dirname, './views'),{
    extension: 'pug'
}))
app.use(async(ctx, next) => {
    await ctx.render('index', {
        you: 'world',
        me: 'xiaobing'
    })
})
app.listen(8080)